package com.example.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import org.springframework.util.ObjectUtils;

/**
 * <p>
 * 类名信息
 * </p>
 *
 * @Author haojieshi
 * @Date 2024/4/30 10:44
 * @Version 1.0
 */
@Getter
@AllArgsConstructor
public enum IndicatorEnums {
        Invoice_achievement("310110001", "开票目标达成"),
        Order_achievement("310110006", "订单达成"),
        Lead_target_achievement("310110007", "线索目标达成"),
        Deal_rate("310110015", "成交率"),
        First_store_visit_achievement("310110002", "首次到店达成"),
        Second_invitation_rate("310110011", "二邀率"),
        DCC_channel_first_invitation_rate("310110008", "DCC全渠道首邀率"),
        DCC_order_ratio("310110009", "DCC订单占比"),
        Car_customer_batch_ratio("310110003", "看车客户批次比"),
        Car_customer_store_visit_interval("310110004", "看车客户进店时间间隔"),
        Customer_flow_allocation_rate("310110016", "客流划拨率"),
        Non_customer_ratio("310110017", "非客占比"),
        _24H_outbound_rate("310110013", "24H外呼率"),
        Zero_service_absorption_rate("310150002", "零服吸收率"),
        EBT_pre_tax_profit("310150003", "EBT（税前净利润）"),
        Pre_tax_profit_margin_ROS("310150006", "税前净利润率（ROS）"),
        New_car_GP1_percent("310150004", "新车GP1%"),
        New_car_GP2_percent("310150005", "新车GP2%");

        private String code;
        private String name;
        public static String getIndexName(String code) {

        for (IndicatorEnums indicatorEnums: IndicatorEnums.values()) {
            if (!ObjectUtils.isEmpty(code)&&code.equals(indicatorEnums.getCode())) {
                return indicatorEnums.getName();
            }
        }
        return null;
    }
}
